const { Tool, API, Event, Storage} = global.$util
Page({
  data: {
    name: '',
  },
  onLoad: function (options) {
  },
  //下一步
  submit() {
    console.log(this.data.name);
    
    if (Tool.isEmptyStr(this.data.name)){
      Tool.showToast("店铺名称不能为空");
      return
    }
    let params = {
      shopName: this.data.name,
    }
    API.createShop(params).then((res) => {
      Tool.redirectTo('/pages/mine/shop/shop')
    }).catch((res) => {
      console.error(res)
    })
  },
  inpName(e) {
    this.setData({
        name: e.detail.value
    })
},
})
